var lock = true;
$.extend({
    avote:{
        putVote:function(u,id){
            
            if(lock){
                var vote = id;
                var aid = $('#aid').val();
                lock = false;
                if(vote==undefined||vote==''){
                    alert('请选择投票项！');return;
                }
            $.post(u,{'vote':vote,'aid':aid},function(data){
                lock = true;
                if(data!='1'){
                    alert('投票成功！请勿重复投票');
                    window.location.reload();
                }else{
                    alert(data);
                }
            });
            }else{
                alert('请求已提交！');
            }
        }
    }
});